/* SPDX-License-Identifier: GPL-2.0-or-later */
/* Copyright(c) 2020 - 2023 Allwinner Technology Co.,Ltd. All rights reserved. */
/*
 * Allwinner SoCs hdmi2.0 driver.
 *
 * Copyright (C) 2016 Allwinner.
 *
 * This file is licensed under the terms of the GNU General Public
 * License version 2.  This program is licensed "as is" without any
 * warranty of any kind, whether express or implied.
 */
#include <sunxi-log.h>
#include <linux/delay.h>
#include "dw_phy.h"
#include "phy_snps.h"

/* phy301 clock: unit:kHZ */
static struct phy_config301 _snps_phy301_table[] = {
	{13500, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x133, 0x0, 0x0, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2173, 0x0, 0x0, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x41B3, 0x0, 0x0, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6132, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x132, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2172, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x41B2, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6131, 0x18, 0x2, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_7, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x131, 0x18, 0x2, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_7, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2171, 0x18, 0x2, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_7, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x41B1, 0x18, 0x2, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_7, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6130, 0x30, 0x3, 0x4, 0x232, 0x8009},
	{18000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00F2, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{18000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2162, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{18000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x41A2, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{18000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x60F1, 0x18, 0x2, 0x4, 0x232, 0x8009},
	{18000, DW_PIXEL_REPETITION_5, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00F1, 0x18, 0x2, 0x4, 0x232, 0x8009},
	{18000, DW_PIXEL_REPETITION_5, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2161, 0x18, 0x2, 0x4, 0x232, 0x8009},
	{18000, DW_PIXEL_REPETITION_5, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x41A1, 0x18, 0x2, 0x4, 0x232, 0x8009},
	{18000, DW_PIXEL_REPETITION_5, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x60F0, 0x31, 0x3, 0x4, 0x232, 0x8009},
	{21600, DW_PIXEL_REPETITION_4, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x151, 0x18, 0x2, 0x4, 0x232, 0x8009},
	{21600, DW_PIXEL_REPETITION_4, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4161, 0x18, 0x2, 0x4, 0x232, 0x8009},
	{21600, DW_PIXEL_REPETITION_4, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6150, 0x31, 0x3, 0x4, 0x232, 0x8009},
	{21600, DW_PIXEL_REPETITION_9, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x150, 0x31, 0x3, 0x4, 0x232, 0x8009},
	{21600, DW_PIXEL_REPETITION_9, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4160, 0x30, 0x3, 0x4, 0x232, 0x8009},
	{21600, DW_PIXEL_REPETITION_9, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7B70, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{24000, DW_PIXEL_REPETITION_8, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00E0, 0x32, 0x3, 0x4, 0x232, 0x8009},
	{24000, DW_PIXEL_REPETITION_8, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7BA0, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{25175, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B3, 0x0, 0x0, 0x4, 0x232, 0x8009},
	{25175, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2153, 0x0, 0x0, 0x4, 0x232, 0x8009},
	{25175, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40F3, 0x0, 0x0, 0x4, 0x232, 0x8009},
	{25175, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x60B2, 0x8, 0x1, 0x4, 0x232, 0x8009},
#if IS_ENABLED(CONFIG_ARCH_SUN8IW16)
	{27000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B3, 0x12, 0x0, 0x7, 0x2b0, 0x8039},
#else
	{27000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B3, 0x12, 0x0, 0x7, 0x2b0, 0x8009},
#endif
	{27000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2153, 0x0, 0x0, 0x4, 0x2b0, 0x8009},
	{27000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40F3, 0x0, 0x0, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x60B2, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B2, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2152, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40F2, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x60B1, 0x19, 0x2, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B1, 0x19, 0x2, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2151, 0x18, 0x2, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40F1, 0x18, 0x2, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x60B0, 0x32, 0x3, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_7, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B0, 0x32, 0x3, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_7, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2150, 0x31, 0x3, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_7, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40F0, 0x31, 0x3, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_7, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7B30, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{31500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B3, 0x0, 0x0, 0x4, 0x232, 0x8009},
	{33750, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B3, 0x0, 0x0, 0x4, 0x232, 0x8009},
	{35500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B3, 0x0, 0x0, 0x4, 0x232, 0x8009},
	{36000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B3, 0x0, 0x0, 0x4, 0x232, 0x8009},
	{36000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00A1, 0x001A, 0x2, 0x4, 0x232, 0x8009},
	{36000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2165, 0x18, 0x2, 0x4, 0x232, 0x8009},
	{36000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40E1, 0x19, 0x2, 0x4, 0x232, 0x8009},
	{36000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x60A0, 0x32, 0x3, 0x4, 0x232, 0x8009},
	{36000, DW_PIXEL_REPETITION_5, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00A0, 0x32, 0x3, 0x4, 0x232, 0x8009},
	{36000, DW_PIXEL_REPETITION_5, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2164, 0x30, 0x3, 0x4, 0x232, 0x8009},
	{36000, DW_PIXEL_REPETITION_5, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40E0, 0x32, 0x3, 0x4, 0x232, 0x8009},
	{36000, DW_PIXEL_REPETITION_5, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7AF0, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{40000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B3, 0x0, 0x0, 0x4, 0x232, 0x8009},
	{43200, DW_PIXEL_REPETITION_4, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x140, 0x33, 0x3, 0x4, 0x232, 0x8009},
	{43200, DW_PIXEL_REPETITION_4, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4164, 0x30, 0x3, 0x4, 0x232, 0x8009},
	{43200, DW_PIXEL_REPETITION_4, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7B50, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{44900, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B3, 0x0, 0x0, 0x4, 0x232, 0x8009},
	{49500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{50000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{50350, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{50350, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2142, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{50350, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40A2, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{50350, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6071, 0x001A, 0x2, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2142, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40A2, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6071, 0x001A, 0x2, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x71, 0x001A, 0x2, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2141, 0x001A, 0x2, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40A1, 0x001A, 0x2, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6070, 0x33, 0x3, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x70, 0x33, 0x3, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2140, 0x33, 0x3, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40A0, 0x32, 0x3, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7AB0, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{56250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{59400, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{59400, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2142, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{59400, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40A2, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{59400, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6071, 0x001A, 0x2, 0x4, 0x232, 0x8009},
	{65000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{68250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{71000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{72000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{72000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2142, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{72000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4061, 0x001B, 0x2, 0x4, 0x232, 0x8009},
	{72000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6071, 0x001A, 0x2, 0x4, 0x232, 0x8009},
	{72000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x60, 0x34, 0x3, 0x4, 0x232, 0x8009},
	{72000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x216C, 0x30, 0x3, 0x4, 0x232, 0x8009},
	{72000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40E4, 0x32, 0x3, 0x4, 0x232, 0x8009},
	{72000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7AA0, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{73250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x8, 0x1, 0x4, 0x232, 0x8009},
#if IS_ENABLED(CONFIG_ARCH_SUN8IW16)
	{74250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x13, 0x1, 0x6, 0x2b0, 0x8039},
#elif IS_ENABLED(CONFIG_ARCH_SUN50IW9)
	{74250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x13, 0x1, 0x4, 0x290, 0x8019},
#else
	{74250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x13, 0x1, 0x6, 0x22d, 0x8009},
#endif
	{74250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2145, 0x0013, 0x1, 0x6, 0x270, 0x8029},
	{74250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4061, 0x0013, 0x1, 0x6, 0x270, 0x8029},
	{74250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6071, 0x001A, 0x2, 0x4, 0x230, 0x8009},
	{75000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{78750, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{79500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{82500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{82500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2145, 0x001A, 0x2, 0x4, 0x232, 0x8009},
	{82500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4061, 0x001B, 0x2, 0x4, 0x232, 0x8009},
	{82500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6071, 0x001A, 0x2, 0x4, 0x230, 0x8009},
	{83500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{85500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{88750, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{90000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x8, 0x1, 0x4, 0x232, 0x8009},
	{90000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2145, 0x001A, 0x2, 0x4, 0x232, 0x8009},
	{90000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4061, 0x001B, 0x2, 0x4, 0x232, 0x8009},
	{90000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6071, 0x001A, 0x2, 0x4, 0x230, 0x8009},
	{94500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x232, 0x8009},
	{99000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x232, 0x8009},
	{99000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2145, 0x001A, 0x2, 0x4, 0x232, 0x8009},
	{99000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4061, 0x001B, 0x2, 0x4, 0x230, 0x8009},
	{99000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6050, 0x35, 0x3, 0x4, 0x230, 0x8009},
	{100700, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x232, 0x8009},
	{100700, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2145, 0x001A, 0x2, 0x4, 0x232, 0x8009},
	{100700, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4061, 0x001B, 0x2, 0x4, 0x230, 0x8009},
	{100700, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6050, 0x35, 0x3, 0x4, 0x230, 0x8009},
	{101000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x232, 0x8009},
	{102250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x232, 0x8009},
	{106500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x232, 0x8009},
	{108000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x232, 0x8009},
	{108000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2145, 0x001A, 0x2, 0x4, 0x232, 0x8009},
	{108000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4061, 0x001B, 0x2, 0x4, 0x230, 0x8009},
	{108000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6050, 0x35, 0x3, 0x4, 0x230, 0x8009},
	{108000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x50, 0x35, 0x3, 0x4, 0x232, 0x8009},
	{108000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2144, 0x33, 0x3, 0x4, 0x232, 0x8009},
	{108000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4060, 0x34, 0x3, 0x4, 0x230, 0x8009},
	{108000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7A70, 0x33, 0x3, 0x4, 0x14A, 0x8039},
	{115500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x232, 0x8009},
	{117500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x232, 0x8009},
	{118800, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x232, 0x8009},
	{118800, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2145, 0x001A, 0x2, 0x4, 0x230, 0x8009},
	{118800, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4061, 0x001B, 0x2, 0x4, 0x230, 0x8009},
	{118800, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6050, 0x35, 0x3, 0x4, 0x273, 0x8009},
	{119000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x232, 0x8009},
	{121750, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x232, 0x8009},
	{122500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x232, 0x8009},
	{135000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x232, 0x8009},
	{136750, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x232, 0x8009},
	{140250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x232, 0x8009},
	{144000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x232, 0x8009},
	{144000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2145, 0x001A, 0x2, 0x4, 0x230, 0x8009},
	{144000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4064, 0x34, 0x3, 0x4, 0x230, 0x8009},
	{144000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6050, 0x35, 0x3, 0x4, 0x273, 0x8009},
	{146250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x232, 0x8009},
	{148250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x232, 0x8009},
#if IS_ENABLED(CONFIG_ARCH_SUN8IW16)
	{148500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x0019, 0x2, 0x6, 0x2b0, 0x8039},
#elif IS_ENABLED(CONFIG_ARCH_SUN50IW9)
	{148500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x0019, 0x2, 0x4, 0x290, 0x8019},
#else
	{148500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x0019, 0x2, 0x6, 0x270, 0x8029},
#endif
	{148500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x214C, 0x19, 0x2, 0x5, 0x1ab, 0x8039},
	{148500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4064, 0x19, 0x2, 0x5, 0x1ab, 0x8039},
	{148500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6050, 0x35, 0x3, 0x4, 0x273, 0x8029},
	{154000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x230, 0x8009},
	{156000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x230, 0x8009},
	{157000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x230, 0x8009},
	{157500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x230, 0x8009},
	{162000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x230, 0x8009},
	{165000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x230, 0x8009},
	{165000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x214C, 0x33, 0x3, 0x4, 0x230, 0x8009},
	{165000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4064, 0x34, 0x3, 0x4, 0x273, 0x8009},
	{165000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6050, 0x35, 0x3, 0x4, 0x273, 0x8029},
	{175500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x230, 0x8009},
	{179500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x230, 0x8009},
	{180000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x230, 0x8009},
	{180000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x214C, 0x33, 0x3, 0x4, 0x273, 0x8009},
	{180000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4064, 0x34, 0x3, 0x4, 0x273, 0x8009},
	{180000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7A50, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{182750, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001B, 0x2, 0x4, 0x230, 0x8009},
	{185625, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x230, 0x8009},
	{185625, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x214C, 0x33, 0x3, 0x4, 0x273, 0x8009},
	{185625, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4064, 0x34, 0x3, 0x4, 0x273, 0x8009},
	{185625, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7A50, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{187000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x230, 0x8009},
	{187250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x230, 0x8009},
	{189000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x230, 0x8009},
	{193250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x230, 0x8009},
	{198000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x230, 0x8009},
	{198000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x214C, 0x33, 0x3, 0x4, 0x273, 0x8009},
	{198000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4064, 0x34, 0x3, 0x4, 0x273, 0x8029},
	{198000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7A50, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{202500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x230, 0x8009},
	{204750, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x230, 0x8009},
	{208000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x230, 0x8009},
	{214750, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x230, 0x8009},
	{216000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x230, 0x8009},
	{216000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x214C, 0x33, 0x3, 0x4, 0x273, 0x8009},
	{216000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4064, 0x34, 0x3, 0x4, 0x273, 0x8029},
	{216000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7A50, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{218250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x230, 0x8009},
	{229500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x273, 0x8009},
	{234000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x273, 0x8009},
	{237600, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x273, 0x8009},
	{237600, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x214C, 0x33, 0x3, 0x4, 0x273, 0x8029},
	{237600, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI_20, 0x5A64, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{237600, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7A50, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{245250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x273, 0x8009},
	{245500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x273, 0x8009},
	{261000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x273, 0x8009},
	{268250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x273, 0x8009},
	{268500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x273, 0x8009},
	{281250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x273, 0x8009},
	{288000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x273, 0x8009},
	{288000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI_20, 0x3B4C, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{288000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI_20, 0x5A64, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{288000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7A50, 0x003D, 0x3, 0x4, 0x14A, 0x8039},
#if IS_ENABLED(CONFIG_ARCH_SUN8IW16)
	{297000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x19, 0x3, 0x5, 0x210, 0x803d},
#elif IS_ENABLED(CONFIG_ARCH_SUN50IW9)
	{297000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x19, 0x3, 0x4, 0x22b, 0x8039},
#else
	{297000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x19, 0x3, 0x5, 0x1ab, 0x8039},
#endif
	{297000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI_20, 0x3B4C, 0x001B, 0x3, 0x0, 0x16A, 0x8019},
	{297000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI_20, 0x5A64, 0x0019, 0x3, 0x0, 0x8A, 0x8029},
	{297000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7A50, 0x003D, 0x3, 0x4, 0x14A, 0x8039},
	{317000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x273, 0x8029},
	{330000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x273, 0x8029},
	{330000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI_20, 0x3B4C, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{330000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI_20, 0x5A64, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{333250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x273, 0x8029},
	{340000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x36, 0x3, 0x4, 0x273, 0x8029},
	{348500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x003F, 0x3, 0x4, 0x14A, 0x8039},
	{356500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x003F, 0x3, 0x4, 0x14A, 0x8039},
	{360000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x003F, 0x3, 0x4, 0x14A, 0x8039},
	{360000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI_20, 0x3B4C, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{360000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI_20, 0x5A64, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{371250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x003F, 0x3, 0x4, 0x14A, 0x8039},
	{371250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI_20, 0x3B4C, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{371250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI_20, 0x5A64, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{396000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x003F, 0x3, 0x4, 0x14A, 0x8039},
	{396000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI_20, 0x3B4C, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{396000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI_20, 0x5A64, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{432000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x003F, 0x3, 0x4, 0x14A, 0x8039},
	{432000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI_20, 0x3B4C, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{443250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x003F, 0x3, 0x4, 0x14A, 0x8039},
	{475200, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x003F, 0x3, 0x4, 0x14A, 0x8039},
	{475200, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI_20, 0x3B4C, 0x001B, 0x3, 0x4, 0x14A, 0x8039},
	{495000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x003F, 0x3, 0x4, 0x14A, 0x8039},
	{505250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x003F, 0x3, 0x4, 0x14A, 0x8039},
	{552750, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x003F, 0x3, 0x4, 0x14A, 0x8039},
	{594000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A7c, 0x0010, 0x3, 0x0, 0x8A, 0x8029},
	{0, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_NULL, DW_PHY_OPMODE_HDMI14, 0, 0, 0, 0, 0, 0}
};

#ifdef SUPPORT_PHY303
static struct phy_config303 _snps_phy303_table[] = {
	{13500, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x133, 0x18, 0x0, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2173, 0x18, 0x0, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x41B3, 0x18, 0x0, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6132, 0x003B, 0x1, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x132, 0x003B, 0x1, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2172, 0x003B, 0x1, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x41B2, 0x003B, 0x1, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6131, 0x39, 0x2, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_7, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x131, 0x39, 0x2, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_7, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2171, 0x39, 0x2, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_7, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x41B1, 0x39, 0x2, 0x4, 0x232, 0x8009},
	{13500, DW_PIXEL_REPETITION_7, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6130, 0x38, 0x3, 0x4, 0x232, 0x8009},
	{18000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00F2, 0x003B, 0x1, 0x4, 0x232, 0x8009},
	{18000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2162, 0x003B, 0x1, 0x4, 0x232, 0x8009},
	{18000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x41A2, 0x003B, 0x1, 0x4, 0x232, 0x8009},
	{18000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x60F1, 0x003B, 0x2, 0x4, 0x232, 0x8009},
	{18000, DW_PIXEL_REPETITION_5, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00F1, 0x003B, 0x2, 0x4, 0x232, 0x8009},
	{18000, DW_PIXEL_REPETITION_5, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2161, 0x39, 0x2, 0x4, 0x232, 0x8009},
	{18000, DW_PIXEL_REPETITION_5, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x41A1, 0x39, 0x2, 0x4, 0x232, 0x8009},
	{18000, DW_PIXEL_REPETITION_5, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x60F0, 0x38, 0x3, 0x4, 0x232, 0x8009},
	{21600, DW_PIXEL_REPETITION_4, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x151, 0x003D, 0x2, 0x4, 0x232, 0x8009},
	{21600, DW_PIXEL_REPETITION_4, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4161, 0x39, 0x2, 0x4, 0x232, 0x8009},
	{21600, DW_PIXEL_REPETITION_4, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6150, 0x38, 0x3, 0x4, 0x232, 0x8009},
	{21600, DW_PIXEL_REPETITION_9, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x150, 0x38, 0x3, 0x4, 0x232, 0x8009},
	{21600, DW_PIXEL_REPETITION_9, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4160, 0x38, 0x3, 0x4, 0x232, 0x8009},
	{21600, DW_PIXEL_REPETITION_9, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7B70, 0x003D, 0x3, 0x4, 0x14A, 0x8039},
	{24000, DW_PIXEL_REPETITION_8, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00E0, 0x39, 0x3, 0x4, 0x232, 0x8009},
	{24000, DW_PIXEL_REPETITION_8, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7BA0, 0x003D, 0x3, 0x4, 0x14A, 0x8039},
	{25175, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B3, 0x001A, 0x0, 0x4, 0x232, 0x8009},
	{25175, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2153, 0x19, 0x0, 0x4, 0x232, 0x8009},
	{25175, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40F3, 0x19, 0x0, 0x4, 0x232, 0x8009},
	{25175, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x60B2, 0x003B, 0x1, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B3, 0x001A, 0x0, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2153, 0x19, 0x0, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40F3, 0x19, 0x0, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x60B2, 0x003B, 0x1, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B2, 0x003B, 0x1, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2152, 0x003B, 0x1, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40F2, 0x003B, 0x1, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x60B1, 0x003F, 0x2, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B1, 0x003F, 0x2, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2151, 0x003D, 0x2, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40F1, 0x003B, 0x2, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x60B0, 0x39, 0x3, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_7, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B0, 0x39, 0x3, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_7, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2150, 0x38, 0x3, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_7, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40F0, 0x38, 0x3, 0x4, 0x232, 0x8009},
	{27000, DW_PIXEL_REPETITION_7, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7B30, 0x003D, 0x3, 0x4, 0x14A, 0x8039},
	{31500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B3, 0x001A, 0x0, 0x4, 0x232, 0x8009},
	{33750, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B3, 0x001A, 0x0, 0x4, 0x232, 0x8009},
	{35500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B3, 0x001A, 0x0, 0x4, 0x232, 0x8009},
	{36000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B3, 0x001A, 0x0, 0x4, 0x232, 0x8009},
	{36000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00A1, 0x003F, 0x2, 0x4, 0x232, 0x8009},
	{36000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2165, 0x39, 0x2, 0x4, 0x232, 0x8009},
	{36000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40E1, 0x003F, 0x2, 0x4, 0x232, 0x8009},
	{36000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x60A0, 0x003B, 0x3, 0x4, 0x232, 0x8009},
	{36000, DW_PIXEL_REPETITION_5, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00A0, 0x003B, 0x3, 0x4, 0x232, 0x8009},
	{36000, DW_PIXEL_REPETITION_5, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2164, 0x38, 0x3, 0x4, 0x232, 0x8009},
	{36000, DW_PIXEL_REPETITION_5, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40E0, 0x39, 0x3, 0x4, 0x232, 0x8009},
	{36000, DW_PIXEL_REPETITION_5, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7AF0, 0x003D, 0x3, 0x4, 0x14A, 0x8039},
	{40000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B3, 0x001A, 0x0, 0x4, 0x232, 0x8009},
	{43200, DW_PIXEL_REPETITION_4, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x140, 0x003D, 0x3, 0x4, 0x232, 0x8009},
	{43200, DW_PIXEL_REPETITION_4, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4164, 0x38, 0x3, 0x4, 0x232, 0x8009},
	{43200, DW_PIXEL_REPETITION_4, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7B50, 0x003D, 0x3, 0x4, 0x14A, 0x8039},
	{44900, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x00B3, 0x001A, 0x0, 0x4, 0x232, 0x8009},
	{49500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x001B, 0x1, 0x4, 0x232, 0x8009},
	{50000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x001B, 0x1, 0x4, 0x232, 0x8009},
	{50350, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x001B, 0x1, 0x4, 0x232, 0x8009},
	{50350, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2142, 0x23, 0x1, 0x4, 0x232, 0x8009},
	{50350, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40A2, 0x002A, 0x1, 0x4, 0x232, 0x8009},
	{50350, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6071, 0x003F, 0x2, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x001B, 0x1, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2142, 0x23, 0x1, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40A2, 0x002A, 0x1, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6071, 0x003F, 0x2, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x71, 0x003F, 0x2, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2141, 0x003F, 0x2, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40A1, 0x003F, 0x2, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6070, 0x003F, 0x3, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x70, 0x003F, 0x3, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2140, 0x003D, 0x3, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40A0, 0x003B, 0x3, 0x4, 0x232, 0x8009},
	{54000, DW_PIXEL_REPETITION_3, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7AB0, 0x003D, 0x3, 0x4, 0x14A, 0x8039},
	{56250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x001B, 0x1, 0x4, 0x232, 0x8009},
	{59400, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x001B, 0x1, 0x4, 0x232, 0x8009},
	{59400, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2142, 0x23, 0x1, 0x4, 0x232, 0x8009},
	{59400, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40A2, 0x002A, 0x1, 0x4, 0x232, 0x8009},
	{59400, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6071, 0x003F, 0x2, 0x4, 0x232, 0x8009},
	{65000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x001B, 0x1, 0x4, 0x232, 0x8009},
	{68250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x001B, 0x1, 0x4, 0x232, 0x8009},
	{71000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x001B, 0x1, 0x4, 0x232, 0x8009},
	{72000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x001B, 0x1, 0x4, 0x232, 0x8009},
	{72000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2142, 0x23, 0x1, 0x4, 0x232, 0x8009},
	{72000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4061, 0x002E, 0x2, 0x4, 0x232, 0x8009},
	{72000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6071, 0x003F, 0x2, 0x4, 0x232, 0x8009},
	{72000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x60, 0x003F, 0x3, 0x4, 0x232, 0x8009},
	{72000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x216C, 0x38, 0x3, 0x4, 0x232, 0x8009},
	{72000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x40E4, 0x39, 0x3, 0x4, 0x232, 0x8009},
	{72000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7AA0, 0x003D, 0x3, 0x4, 0x14A, 0x8039},
	{73250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x001B, 0x1, 0x4, 0x232, 0x8009},
	{74250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x001B, 0x1, 0x4, 0x232, 0x8009},
	{74250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2145, 0x003F, 0x2, 0x4, 0x232, 0x8009},
	{74250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4061, 0x002E, 0x2, 0x4, 0x232, 0x8009},
	{74250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6071, 0x003F, 0x2, 0x4, 0x230, 0x8009},
	{75000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x001B, 0x1, 0x4, 0x232, 0x8009},
	{78750, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x001B, 0x1, 0x4, 0x232, 0x8009},
	{79500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x001B, 0x1, 0x4, 0x232, 0x8009},
	{82500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x001B, 0x1, 0x4, 0x232, 0x8009},
	{82500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2145, 0x003F, 0x2, 0x4, 0x232, 0x8009},
	{82500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4061, 0x002E, 0x2, 0x4, 0x232, 0x8009},
	{82500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6071, 0x003F, 0x2, 0x4, 0x230, 0x8009},
	{83500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x001B, 0x1, 0x4, 0x232, 0x8009},
	{85500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x001B, 0x1, 0x4, 0x232, 0x8009},
	{88750, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x001B, 0x1, 0x4, 0x232, 0x8009},
	{90000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x72, 0x001B, 0x1, 0x4, 0x232, 0x8009},
	{90000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2145, 0x003F, 0x2, 0x4, 0x232, 0x8009},
	{90000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4061, 0x002E, 0x2, 0x4, 0x232, 0x8009},
	{90000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6071, 0x003F, 0x2, 0x4, 0x230, 0x8009},
	{94500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x232, 0x8009},
	{99000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x232, 0x8009},
	{99000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2145, 0x003F, 0x2, 0x4, 0x232, 0x8009},
	{99000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4061, 0x002E, 0x2, 0x4, 0x230, 0x8009},
	{99000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6050, 0x003F, 0x3, 0x4, 0x230, 0x8009},
	{100700, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x232, 0x8009},
	{100700, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2145, 0x003F, 0x2, 0x4, 0x232, 0x8009},
	{100700, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4061, 0x002E, 0x2, 0x4, 0x230, 0x8009},
	{100700, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6050, 0x003F, 0x3, 0x4, 0x230, 0x8009},
	{101000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x232, 0x8009},
	{102250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x232, 0x8009},
	{106500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x232, 0x8009},
	{108000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x232, 0x8009},
	{108000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2145, 0x003F, 0x2, 0x4, 0x232, 0x8009},
	{108000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4061, 0x002E, 0x2, 0x4, 0x230, 0x8009},
	{108000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6050, 0x003F, 0x3, 0x4, 0x230, 0x8009},
	{108000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x50, 0x003F, 0x3, 0x4, 0x232, 0x8009},
	{108000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2144, 0x003D, 0x3, 0x4, 0x232, 0x8009},
	{108000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4060, 0x003F, 0x3, 0x4, 0x230, 0x8009},
	{108000, DW_PIXEL_REPETITION_1, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7A70, 0x003E, 0x3, 0x4, 0x14A, 0x8039},
	{108000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A70, 0x003E, 0x3, 0x4, 0x14A, 0x8039},
	{108000, DW_PIXEL_REPETITION_2, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI_20, 0x3B40, 0x003D, 0x3, 0x4, 0x14A, 0x8039},
	{115500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x232, 0x8009},
	{117500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x232, 0x8009},
	{118800, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x232, 0x8009},
	{118800, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2145, 0x003F, 0x2, 0x4, 0x230, 0x8009},
	{118800, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4061, 0x002E, 0x2, 0x4, 0x230, 0x8009},
	{118800, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6050, 0x003F, 0x3, 0x4, 0x273, 0x8009},
	{119000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x232, 0x8009},
	{121750, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x232, 0x8009},
	{122500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x232, 0x8009},
	{135000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x232, 0x8009},
	{136750, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x232, 0x8009},
	{140250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x232, 0x8009},
	{144000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x232, 0x8009},
	{144000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x2145, 0x003F, 0x2, 0x4, 0x230, 0x8009},
	{144000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4064, 0x003F, 0x3, 0x4, 0x230, 0x8009},
	{144000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6050, 0x003F, 0x3, 0x4, 0x273, 0x8009},
	{146250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x232, 0x8009},
	{148250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x232, 0x8009},
	{148500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x230, 0x8009},
	{148500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x214C, 0x003D, 0x3, 0x4, 0x230, 0x8009},
	{148500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4064, 0x003F, 0x3, 0x4, 0x273, 0x8009},
	{148500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6050, 0x003F, 0x3, 0x4, 0x273, 0x8029},
	{154000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x230, 0x8009},
	{156000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x230, 0x8009},
	{157000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x230, 0x8009},
	{157500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x230, 0x8009},
	{162000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x230, 0x8009},
	{165000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x230, 0x8009},
	{165000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x214C, 0x003D, 0x3, 0x4, 0x230, 0x8009},
	{165000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4064, 0x003F, 0x3, 0x4, 0x273, 0x8009},
	{165000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI14, 0x6050, 0x003F, 0x3, 0x4, 0x273, 0x8029},
	{175500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x230, 0x8009},
	{179500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x230, 0x8009},
	{180000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x230, 0x8009},
	{180000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x214C, 0x003D, 0x3, 0x4, 0x273, 0x8009},
	{180000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4064, 0x003F, 0x3, 0x4, 0x273, 0x8009},
	{180000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7A50, 0x30, 0x3, 0x4, 0x14A, 0x8039},
	{182750, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x51, 0x001C, 0x2, 0x4, 0x230, 0x8009},
	{185625, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x230, 0x8009},
	{185625, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x214C, 0x003D, 0x3, 0x4, 0x273, 0x8009},
	{185625, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4064, 0x003F, 0x3, 0x4, 0x273, 0x8009},
	{185625, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7A50, 0x30, 0x3, 0x4, 0x14A, 0x8039},
	{187000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x230, 0x8009},
	{187250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x230, 0x8009},
	{189000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x230, 0x8009},
	{193250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x230, 0x8009},
	{198000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x230, 0x8009},
	{198000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x214C, 0x003D, 0x3, 0x4, 0x273, 0x8009},
	{198000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4064, 0x003F, 0x3, 0x4, 0x273, 0x8029},
	{198000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7A50, 0x30, 0x3, 0x4, 0x14A, 0x8039},
	{202500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x230, 0x8009},
	{204750, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x230, 0x8009},
	{208000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x230, 0x8009},
	{214750, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x230, 0x8009},
	{216000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x230, 0x8009},
	{216000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x214C, 0x003D, 0x3, 0x4, 0x273, 0x8009},
	{216000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI14, 0x4064, 0x003F, 0x3, 0x4, 0x273, 0x8029},
	{216000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7A50, 0x30, 0x3, 0x4, 0x14A, 0x8039},
	{216000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A50, 0x30, 0x3, 0x4, 0x14A, 0x8039},
	{216000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI_20, 0x3B44, 0x003D, 0x3, 0x4, 0x14A, 0x8039},
	{218250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x230, 0x8009},
	{229500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x273, 0x8009},
	{234000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x273, 0x8009},
	{237600, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x273, 0x8009},
	{237600, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI14, 0x214C, 0x003D, 0x3, 0x4, 0x273, 0x8029},
	{237600, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI_20, 0x5A64, 0x002A, 0x3, 0x4, 0x14A, 0x8039},
	{237600, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7A50, 0x30, 0x3, 0x4, 0x14A, 0x8039},
	{245250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x273, 0x8009},
	{245500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x273, 0x8009},
	{261000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x273, 0x8009},
	{268250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x273, 0x8009},
	{268500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x273, 0x8009},
	{281250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x273, 0x8009},
	{288000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x273, 0x8009},
	{288000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI_20, 0x3B4C, 0x003D, 0x3, 0x4, 0x14A, 0x8039},
	{288000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI_20, 0x5A64, 0x002A, 0x3, 0x4, 0x14A, 0x8039},
	{288000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7A50, 0x22, 0x3, 0x4, 0x14A, 0x8039},
	{297000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x273, 0x8029},
	{297000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI_20, 0x3B4C, 0x003D, 0x3, 0x4, 0x14A, 0x8039},
	{297000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI_20, 0x5A64, 0x002A, 0x3, 0x4, 0x14A, 0x8039},
	{297000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_16, DW_PHY_OPMODE_HDMI_20, 0x7A50, 0x22, 0x3, 0x4, 0x14A, 0x8039},
	{317000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x273, 0x8029},
	{330000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x273, 0x8029},
	{330000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI_20, 0x3B4C, 0x003D, 0x3, 0x4, 0x14A, 0x8039},
	{330000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI_20, 0x5A64, 0x002A, 0x3, 0x4, 0x14A, 0x8039},
	{333250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x273, 0x8029},
	{340000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI14, 0x40, 0x001D, 0x3, 0x4, 0x273, 0x8029},
	{348500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x8, 0x3, 0x4, 0x14A, 0x8039},
	{356500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x8, 0x3, 0x4, 0x14A, 0x8039},
	{360000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x8, 0x3, 0x4, 0x14A, 0x8039},
	{360000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI_20, 0x3B4C, 0x003D, 0x3, 0x4, 0x14A, 0x8039},
	{360000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI_20, 0x5A64, 0x002A, 0x3, 0x4, 0x14A, 0x8039},
	{371250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x8, 0x3, 0x4, 0x14A, 0x8039},
	{371250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI_20, 0x3B4C, 0x003D, 0x3, 0x4, 0x14A, 0x8039},
	{371250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI_20, 0x5A64, 0x002A, 0x3, 0x4, 0x14A, 0x8039},
	{380500, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x8, 0x3, 0x4, 0x14A, 0x8039},
	{396000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x8, 0x3, 0x4, 0x14A, 0x8039},
	{396000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI_20, 0x3B4C, 0x003D, 0x3, 0x4, 0x14A, 0x8039},
	{396000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_12, DW_PHY_OPMODE_HDMI_20, 0x5A64, 0x002A, 0x3, 0x4, 0x14A, 0x8039},
	{432000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x8, 0x3, 0x4, 0x14A, 0x8039},
	{432000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI_20, 0x3B4C, 0x003D, 0x3, 0x4, 0x14A, 0x8039},
	{443250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x8, 0x3, 0x4, 0x14A, 0x8039},
	{475200, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x8, 0x3, 0x4, 0x14A, 0x8039},
	{475200, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_10, DW_PHY_OPMODE_HDMI_20, 0x3B4C, 0x003D, 0x3, 0x4, 0x14A, 0x8039},
	{495000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x8, 0x3, 0x4, 0x14A, 0x8039},
	{505250, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x8, 0x3, 0x4, 0x14A, 0x8039},
	{552750, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x8, 0x3, 0x4, 0x14A, 0x8039},
	{594000, DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_8, DW_PHY_OPMODE_HDMI_20, 0x1A40, 0x8, 0x3, 0x4, 0x14A, 0x8039},
	{0,  DW_PIXEL_REPETITION_OFF, DW_COLOR_DEPTH_NULL, DW_PHY_OPMODE_HDMI14, 0, 0, 0, 0, 0, 0}
};

u32 _snps_phy_303_get_freq(u32 pClk)
{
	if (((pClk >= 25175) && (pClk <= 25180)) ||
			((pClk >= 25195) && (pClk <= 25205)))
		return 25175;
	else if (((pClk >= 26995) && (pClk <= 27005)) ||
				((pClk >= 27022) && (pClk <= 27032)))
		return 27000;
	else if (pClk == 31500)
		return 31500;
	else if (pClk == 33750)
		return 33750;
	else if (pClk == 35500)
		return 35500;
	else if (((pClk >= 35995) && (pClk <= 36005)) ||
			((pClk >= 36031) && (pClk <= 36041)))
		return 36000;
	else if (pClk == 40000)
		return 40000;
	else if (pClk == 44900)
		return 44900;
	else if (pClk == 49500)
		return 49500;
	else if (pClk == 50000)
		return 50000;
	else if (((pClk >= 50345) && (pClk <= 50355)) ||
				((pClk >= 50395) && (pClk <= 50405)))
		return 50350;
	else if (((pClk >= 53995) && (pClk <= 54005)) ||
				((pClk >= 50049) && (pClk <= 54059)))
		return 54000;
	else if (pClk == 56250)
		return 56250;
	else if (((pClk >= 59336) && (pClk <= 59346)) ||
				((pClk >= 59395) && (pClk <= 59405)))
		return 59400;
	else if (pClk == 65000)
		return 65000;
	else if (pClk == 68250)
		return 68250;
	else if (pClk == 71000)
		return 71000;
	else if (pClk == 72000)
		return 72000;
	else if (pClk == 73250)
		return 73250;
	else if (((pClk >= 74171) && (pClk <= 74181)) ||
				((pClk >= 74245) && (pClk <= 74255)))
		return 74250;
	else if (pClk == 75000)
		return 75000;
	else if (pClk == 78750)
		return 78750;
	else if (pClk == 79500)
		return 79500;
	else if (((pClk >= 82143) && (pClk <= 82153)) ||
				((pClk >= 82495) && (pClk <= 82505)))
		return 82500;
	else if (pClk == 83500)
		return 83500;
	else if (pClk == 85500)
		return 85500;
	else if (pClk == 88750)
		return 88750;
	else if (pClk == 90000)
		return 90000;
	else if (pClk == 94500)
		return 94500;
	else if (((pClk >= 98896) && (pClk <= 98906)) ||
				((pClk >= 98995) && (pClk <= 99005)))
		return 99000;
	else if (((pClk >= 100695) && (pClk <= 100705)) ||
				((pClk >= 100795) && (pClk <= 100805)))
		return 100700;
	else if (pClk == 101000)
		return 101000;
	else if (pClk == 102250)
		return 102250;
	else if (pClk == 106500)
		return 106500;
	else if (((pClk > 107994) && (pClk < 108006)) ||
					((pClk > 108102) && (pClk < 108114)))
		return 108000;
	else if (pClk == 115500)
		return 115500;
	else if (pClk == 117500)
		return 117500;
	else if (((pClk >= 118795) && (pClk <= 118805)) ||
			((pClk >= 118677) && (pClk <= 118687)))
		return 118800;
	else if (pClk == 119000)
		return 119000;
	else if (pClk == 121750)
		return 122500;
	else if (pClk == 122500)
		return 121750;
	else if (pClk == 135000)
		return 135000;
	else if (pClk == 136750)
		return 136750;
	else if (pClk == 140250)
		return 140250;
	else if (pClk == 144000)
		return 144000;
	else if (pClk == 146250)
		return 146250;
	else if (pClk == 148250)
		return 148250;
	else if (((pClk >= 148347) && (pClk <= 148357)) ||
				((pClk >= 148495) && (pClk <= 148505)))
		return 148500;
	else if (pClk == 154000)
		return 154000;
	else if (pClk == 156000)
		return 156000;
	else if (pClk == 157000)
		return 157000;
	else if (pClk == 157500)
		return 157500;
	else if (pClk == 162000)
		return 162000;
	else if (((pClk >= 164830) && (pClk <= 164840)) ||
				((pClk >= 164995) && (pClk <= 165005)))
		return 165000;
	else if (pClk == 175500)
		return 175500;
	else if (pClk == 179500)
		return 179500;
	else if (pClk == 180000)
		return 180000;
	else if (pClk == 182750)
		return 182750;
	else if (((pClk >= 185435) && (pClk <= 185445)) ||
				((pClk >= 185620) && (pClk <= 185630)))
		return 185625;
	else if (pClk == 187000)
		return 187000;
	else if (pClk == 187250)
		return 187250;
	else if (pClk == 189000)
		return 189000;
	else if (pClk == 193250)
		return 193250;
	else if (((pClk >= 197797) && (pClk <= 197807)) ||
				((pClk >= 197995) && (pClk <= 198005)))
		return 198000;
	else if (pClk == 202500)
		return 202500;
	else if (pClk == 204750)
		return 204750;
	else if (pClk == 208000)
		return 208000;
	else if (pClk == 214750)
		return 214750;
	else if (((pClk >= 216211) && (pClk <= 216221)) ||
				((pClk >= 215995) && (pClk <= 216005)))
		return 216000;
	else if (pClk == 218250)
		return 218250;
	else if (pClk == 229500)
		return 229500;
	else if (pClk == 234000)
		return 234000;
	else if (((pClk >= 237359) && (pClk <= 237369)) ||
				((pClk >= 237595) && (pClk <= 237605)))
		return 237600;
	else if (pClk == 245250)
		return 245250;
	else if (pClk == 245500)
		return 245500;
	else if (pClk == 261000)
		return 261000;
	else if (pClk == 268250)
		return 268250;
	else if (pClk == 268500)
		return 268500;
	else if (pClk == 281250)
		return 281250;
	else if (pClk == 288000)
		return 288000;
	else if (((pClk >= 296698) && (pClk <= 296708)) ||
				((pClk >= 296995) && (pClk <= 297005)))
		return 297000;
	else if (pClk == 317000)
		return 317000;
	else if (pClk == 330000)
		return 330000;
	else if (pClk == 333250)
		return 333250;
	else if (((pClk >= 339655) && (pClk <= 339665)) ||
			((pClk >= 339995) && (pClk <= 340005)))
		return 340000;
	else if (pClk == 348500)
		return 348500;
	else if (pClk == 356500)
		return 356500;
	else if (pClk == 360000)
		return 360000;
	else if (((pClk >= 370874) && (pClk <= 370884)) ||
				((pClk >= 371245) && (pClk <= 371255)))
		return 371250;
	else if (pClk == 380500)
		return 380500;
	else if (((pClk >= 395599) && (pClk <= 395609)) ||
				((pClk >= 395995) && (pClk <= 396005)))
		return 396000;
	else if (((pClk >= 431952) && (pClk <= 431967)) ||
			((pClk >= 431995) && (pClk <= 432005)) ||
			((pClk >= 432427) && (pClk <= 432437)))
		return 432000;
	else if (pClk == 443250)
		return 443250;
	else if (((pClk >= 475148) && (pClk <= 475158)) ||
			((pClk >= 475195) && (pClk <= 475205)) ||
			((pClk >= 474723) && (pClk <= 474733)))
		return 475200;
	else if (((pClk >= 494500) && (pClk <= 494510)) ||
			((pClk >= 494995) && (pClk <= 495005)))
		return 495000;
	else if (pClk == 505250)
		return 505250;
	else if (pClk == 552750)
		return 552750;
	else if (((pClk >= 593995) && (pClk <= 594005)) ||
			((pClk >= 593403) && (pClk <= 593413)))
		return 594000;
	else {
		hdmi_err("%s: Unable to map input pixel clock frequency %dkHz\n", __func__, pClk);
	}
	return 1000;
}

static struct phy_config303 *_snps_phy_303_get_configs(u32 pClk, dw_color_depth_t color,
		dw_pixel_repetition_t pixel)
{

	int i = 0;

	for (i = 0; _snps_phy303_table[i].clock != 0; i++) {

		pClk = _snps_phy_303_get_freq(pClk);

		if ((pClk == _snps_phy303_table[i].clock) &&
				(color == _snps_phy303_table[i].color) &&
				(pixel == _snps_phy303_table[i].pixel)) {
			return &(_snps_phy303_table[i]);
		}
	}

	return NULL;
}

static int _snps_phy303_configure(dw_hdmi_dev_t *dev, u32 pClk, dw_color_depth_t color,
						dw_pixel_repetition_t pixel)
{
	int i   = 0;
	u16 phyRead = 0;
	u8 lock = 0;
	struct phy_config303 *config = NULL;
	u32 value = 0;

	/* Color resolution 0 is 8 bit color depth */
	if (color == 0)
		color = DW_COLOR_DEPTH_8;

	config = _snps_phy_303_get_configs(pClk, color, pixel);
	if (config == NULL) {
		hdmi_err("%s: Configuration for clk %dkhz color depth %d pixel repetition %d\n",
				  __func__, pClk, color, pixel);
		return -1;
	}

	value = dev_read(dev, 0xb0020);
	value |= (1 << 9);
	dev_write(dev, 0xb0020, value);

	/* board_ZcalReset(1); */

	dw_mc_phy_reset(dev, 1);

	dw_phy_gen2_tx_power_on(dev, 0);

	dw_phy_gen2_pddq(dev, 1);

	dw_phy_config_svsret(dev, 0);

	/* board_ZcalReset(0); */
	do {
		udelay(5);
	} while (!(dev_read(dev, 0xb0010) & 0x1) && (i++ < SNPS_TIMEOUT));

	dw_phy_config_svsret(dev, 1);

	dw_mc_phy_reset(dev, 0);

	dw_phy_reconfigure_interface(dev);

	dw_phy_write(dev, OPMODE_PLLCFG, config->oppllcfg);
	dw_phy_read(dev, OPMODE_PLLCFG, &phyRead);
	if (phyRead != config->oppllcfg)
		hdmi_err("%s: OPMODE_PLLCFG Mismatch Write 0x%04x Read 0x%04x\n",
				__func__, config->oppllcfg, phyRead);

	dw_phy_write(dev, PLLCURRCTRL, config->pllcurrctrl);
	dw_phy_read(dev, PLLCURRCTRL, &phyRead);
	if (phyRead != config->pllcurrctrl)
		hdmi_err("%s: PLLCURRCTRL Mismatch Write 0x%04x Read 0x%04x\n",
				__func__, config->pllcurrctrl, phyRead);

	dw_phy_write(dev, PLLGMPCTRL, config->pllgmpctrl);
	dw_phy_read(dev, PLLGMPCTRL, &phyRead);
	if (phyRead != config->pllgmpctrl)
		hdmi_err("%s: PLLGMPCTRL Mismatch Write 0x%04x Read 0x%04x\n",
				__func__, config->pllgmpctrl, phyRead);

	dw_phy_write(dev, TXTERM, config->txterm);
	dw_phy_read(dev, TXTERM, &phyRead);
	if (phyRead != config->txterm)
		hdmi_err("%s: TXTERM Mismatch Write 0x%04x Read 0x%04x\n",
				__func__, config->txterm, phyRead);

	dw_phy_write(dev, CKSYMTXCTRL, config->cksymtxctrl);
	dw_phy_read(dev, CKSYMTXCTRL, &phyRead);
	if (phyRead != config->cksymtxctrl)
		hdmi_err("%s: CKSYMTXCTRL Mismatch Write 0x%04x Read 0x%04x\n",
				__func__, config->cksymtxctrl, phyRead);

	dw_phy_write(dev, VLEVCTRL, config->vlevctrl);
	dw_phy_read(dev, VLEVCTRL, &phyRead);
	if (phyRead != config->vlevctrl)
		hdmi_err("%s: VLEVCTRL Mismatch Write 0x%04x Read 0x%04x\n",
				__func__, config->vlevctrl, phyRead);

	dev_write_mask(dev, PHY_CONF0, PHY_CONF0_PDDQ_MASK, 0);
	dev_write_mask(dev, PHY_CONF0, PHY_CONF0_TXPWRON_MASK, 1);

	if (dw_phy_wait_lock(dev) == 1) {
		hdmi_inf("phy 303 pll locked!\n");
		return true;
	}

	hdmi_err("%s: phy 303 pll not locked!!!\n", __func__);
	return false;
}
#endif

static u32 _snps_phy301_auto_get_freq(u32 pClk)
{
	int table_size = (sizeof(_snps_phy301_table) / sizeof(struct phy_config301) - 1);
	int index = 0;
	u32 ref_clk = 0;

	/* check min clock */
	if (pClk < _snps_phy301_table[0].clock) {
		ref_clk = _snps_phy301_table[0].clock;
		hdmi_wrn("raw clock %ukHz change use min ref clock %ukHz!\n",
			pClk, ref_clk);
		return ref_clk;
	}

	/* check max clock */
	if (pClk >  _snps_phy301_table[table_size - 1].clock) {
		ref_clk = _snps_phy301_table[table_size - 1].clock;
		hdmi_wrn("raw clock %ukHz change use max ref clock %ukHz!\n",
			pClk, ref_clk);
		return ref_clk;
	}

	/* loop check clock is match in table */
	for (index = 0; index < table_size; index++) {
		if (pClk == _snps_phy301_table[index].clock) {
			ref_clk = pClk;
			return ref_clk;
		}
	}

	/* loop check unmatch and use near clock */
	for (index = 0; index < table_size; index++) {
		if (pClk > _snps_phy301_table[index].clock &&
				pClk < _snps_phy301_table[index + 1].clock) {
			if ((pClk - _snps_phy301_table[index].clock) >
					(_snps_phy301_table[index + 1].clock - pClk))
				ref_clk = _snps_phy301_table[index + 1].clock;
			else
				ref_clk = _snps_phy301_table[index].clock;
		}
		hdmi_inf("raw clock %ukHz change use near ref clock %ukHz!\n",
			pClk, ref_clk);
		return ref_clk;
	}

	hdmi_wrn("phy auto get freq has issue, return raw clock %ukHz.", pClk);
	return pClk;
}

static struct phy_config301 *_snps_phy301_get_configs(u32 pClk,
		dw_color_depth_t color, dw_pixel_repetition_t pixel)
{
	int i = 0;

	for (i = 0; _snps_phy301_table[i].clock != 0; i++) {
		pClk = _snps_phy301_auto_get_freq(pClk);
		if ((pClk == _snps_phy301_table[i].clock) &&
				(color == _snps_phy301_table[i].color) &&
				(pixel == _snps_phy301_table[i].pixel)) {
			hdmi_inf("phy301 get index: %d. param:\n", i);
			hdmi_inf(" - oppllcfg: 0x%x\n", _snps_phy301_table[i].oppllcfg);
			hdmi_inf(" - pllcurrctrl: 0x%x\n", _snps_phy301_table[i].pllcurrctrl);
			hdmi_inf(" - pllgmpctrl: 0x%x\n", _snps_phy301_table[i].pllgmpctrl);
			hdmi_inf(" - txterm: 0x%x\n", _snps_phy301_table[i].txterm);
			hdmi_inf(" - vlevctrl: 0x%x\n", _snps_phy301_table[i].vlevctrl);
			hdmi_inf(" - cksymtxctrl: 0x%x\n", _snps_phy301_table[i].cksymtxctrl);
			return &(_snps_phy301_table[i]);
		}
	}
	hdmi_err("snps phy301 get config failed!!!\n");

	return NULL;
}

static int _snps_phy301_configure(dw_hdmi_dev_t *dev, u32 pClk, dw_color_depth_t color,
						dw_pixel_repetition_t pixel)
{
	u16 phyRead = 0;
	struct phy_config301 *config = NULL;

	LOG_TRACE3(pClk, color, pixel);

	/* Color resolution 0 is 8 bit color depth */
	if (color == 0)
		color = DW_COLOR_DEPTH_8;

	config = _snps_phy301_get_configs(pClk, color, pixel);
	if (config == NULL) {
		hdmi_err("%s: failed to get phy config when clock %dhz, color depth %d, pixel repetition %d\n",
			__func__, pClk, color, pixel);
		return -1;
	}

	dw_mc_phy_reset(dev, 1);

	dw_phy_gen2_pddq(dev, 1);

	dw_phy_gen2_tx_power_on(dev, 0);

	dw_phy_config_svsret(dev, 0);
	/* udelay(5); */
	dw_phy_config_svsret(dev, 1);

	dw_mc_phy_reset(dev, 0);

	/* dev->snps_hdmi_ctrl.phy_access = DW_PHY_ACCESS_I2C; */
	dw_phy_reconfigure_interface(dev);

	dw_phy_write(dev, OPMODE_PLLCFG, config->oppllcfg);
	if (dw_phy_read(dev, OPMODE_PLLCFG, &phyRead) || (phyRead != config->oppllcfg))
		hdmi_err("%s: OPMODE_PLLCFG Mismatch Write 0x%04x Read 0x%04x\n",
				__func__, config->oppllcfg, phyRead);

	dw_phy_write(dev, PLLCURRCTRL, config->pllcurrctrl);
	if (dw_phy_read(dev, PLLCURRCTRL, &phyRead) || (phyRead != config->pllcurrctrl))
		hdmi_err("%s: PLLCURRCTRL Mismatch Write 0x%04x Read 0x%04x\n",
				__func__, config->pllcurrctrl, phyRead);

#if IS_ENABLED(CONFIG_ARCH_SUN50IW9)
	dw_phy_write(dev, PLLGMPCTRL, 3);
	dw_phy_read(dev, PLLGMPCTRL, &phyRead);
	if (phyRead != 3)
		hdmi_err("%s: PLLGMPCTRL Mismatch Write 0x%04x Read 0x%04x\n",
				__func__, config->pllgmpctrl, phyRead);
#else
	dw_phy_write(dev, PLLGMPCTRL, config->pllgmpctrl);
	dw_phy_read(dev, PLLGMPCTRL, &phyRead);
	if (phyRead != config->pllgmpctrl)
		hdmi_err("%s: PLLGMPCTRL Mismatch Write 0x%04x Read 0x%04x\n",
				__func__, config->pllgmpctrl, phyRead);
#endif

	dw_phy_write(dev, TXTERM, config->txterm);
	if (dw_phy_read(dev, TXTERM, &phyRead) || (phyRead != config->txterm))
		hdmi_err("%s: TXTERM Mismatch Write 0x%04x Read 0x%04x\n",
				__func__, config->txterm, phyRead);

	dw_phy_write(dev, CKSYMTXCTRL, config->cksymtxctrl);
	if (dw_phy_read(dev, CKSYMTXCTRL, &phyRead) || (phyRead != config->cksymtxctrl))
		hdmi_err("%s: CKSYMTXCTRL Mismatch Write 0x%04x Read 0x%04x\n",
				__func__, config->cksymtxctrl, phyRead);

	dw_phy_write(dev, VLEVCTRL, config->vlevctrl);
	if (dw_phy_read(dev, VLEVCTRL, &phyRead) || (phyRead != config->vlevctrl))
		hdmi_err("%s: VLEVCTRL Mismatch Write 0x%04x Read 0x%04x\n",
				__func__, config->vlevctrl, phyRead);

	if (dev->snps_hdmi_ctrl.pixel_clock == 594000) {
		dw_phy_write(dev, 0x17, 0x8006);
		if (dw_phy_read(dev, 0x17, &phyRead) || (phyRead != 0x8006))
			hdmi_err("%s: VLEVCTRL Mismatch Write 0x8006 Read 0x%04x\n",
					__func__, phyRead);
	}

	dw_phy_gen2_pddq(dev, 0);

	dw_phy_gen2_tx_power_on(dev, 1);

	if (dw_phy_wait_lock(dev) == 1) {
		hdmi_inf("phy 301 pll locked!\n");
		return true;
	}

	hdmi_err("%s: phy 301 pll not locked!!!\n", __func__);
	return false;
}

int snps_phy_write(dw_hdmi_dev_t *dev, u8 addr, u16 data)
{
	return dw_phy_write(dev, addr, data);
}

int snps_phy_read(dw_hdmi_dev_t *dev, u8 addr, u16 *value)
{
	return dw_phy_read(dev, addr, value);
}

int snps_phy_configure(dw_hdmi_dev_t *dev, u16 phy_model)
{
	LOG_TRACE();
	if (phy_model == PHY_MODEL_301) {
		return _snps_phy301_configure(dev, dev->snps_hdmi_ctrl.pixel_clock,
					dev->snps_hdmi_ctrl.color_resolution,
					dev->snps_hdmi_ctrl.pixel_repetition);
	}

#ifdef SUPPORT_PHY303
	if (phy_model == PHY_MODEL_303) {
		return _snps_phy303_configure(dev, dev->snps_hdmi_ctrl.pixel_clock,
					dev->snps_hdmi_ctrl.color_resolution,
					dev->snps_hdmi_ctrl.pixel_repetition);
	}
#endif
	hdmi_err("%s: PHY not supported %d\n", __func__, phy_model);

	return false;
}
